package com.katze.common.ws.protocol;

import java.util.HashMap;

public class Notification extends HashMap<String, Object> {

    protected Notification(String title, String msg) {
        super.put("title", title);
        super.put("message", msg);
        super.put("position", "bottom-right");
    }

    public Notification duration(long duration) {
        super.put("duration", duration);
        return this;
    }

    public Notification hideClose() {
        super.put("showClose", false);
        return this;
    }

    public Notification useHtml() {
        super.put("dangerouslyUseHTMLString", true);
        return this;
    }

    public Notification data(Object data){
        super.put("data", data);
        return this;
    }

    public void success() {
        super.put("type", "success");
    }

    public void error() {
        super.put("type", "error");
    }
}
